{% import 'Dockerfile/docker.jinja2' as docker %}
{% import 'Dockerfile/provision.jinja2' as provision %}

{% macro ubuntu(role='') -%}
    # Install services
    && apt-install \
        dovecot-core \
        dovecot-imapd \
    && docker-service enable postfix \
    && docker-service enable dovecot
{%- endmacro %}

{% macro roundcube(role='') -%}
    # Install Roundcube + plugins
    && cd /app \
    && rm -rf * \
    && wget https://github.com/roundcube/roundcubemail/releases/download/1.2.2/roundcubemail-1.2.2-complete.tar.gz \
    && tar xf roundcubemail-1.2.2-complete.tar.gz  --strip-components 1 \
    && rm -f roundcubemail-1.2.2-complete.tar.gz \
    && ls -l  \
    && rm -rf .git installer \
    && ln -s /opt/docker/etc/roundcube/plugins/webdevops_autologin/ plugins/webdevops_autologin \
    && ln -s /opt/docker/etc/roundcube/config.php config/config.inc.php
{%- endmacro %}
